package com.jingsheng.jingshengcity.mvp.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.jingsheng.jingshengcity.mvp.ui.fragment.order.MyOrderPageFragment;

/**
 * Created by Administrator on 2017/5/10.
 */

public class MyOrderTabAdapter extends FragmentStatePagerAdapter {

    private String[] mTitles;

    public MyOrderTabAdapter(FragmentManager fm, String[] titles) {
        super(fm);
        mTitles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return MyOrderPageFragment.newInstance();
        } else if (position == 1) {
            return MyOrderPageFragment.newInstance();
        } else if (position == 2) {
            return MyOrderPageFragment.newInstance();
        } else if (position == 3) {
            return MyOrderPageFragment.newInstance();
        } else if (position == 4) {
            return MyOrderPageFragment.newInstance();
        } else if (position == 5) {
            return MyOrderPageFragment.newInstance();
        } else {
            return MyOrderPageFragment.newInstance();
        }
    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
}
